import 'package:bxultimate/data/request/base_request.dart';
import 'package:bxultimate/shared/constant/app_constant.dart';
import 'package:bxultimate/shared/shared.dart';
import 'package:get/get.dart';

class ConfigStore extends GetxController {
  static ConfigStore get to => Get.find();

  final _baseFileUrl = "".obs;

  final _theme = AppConstant.themeLight.obs;

  String get baseFileUrl => _baseFileUrl.value;
  String get theme => _theme.value;

  @override
  Future<void> onInit() async {
    super.onInit();
    _baseFileUrl.value = await BaseRequest.getFilePrefix();
    UtilSp.putString(AppConstant.assetsPrefix, _baseFileUrl.value);

    // 主题
    _theme.value = UtilSp.getString(AppConstant.theme, defValue: "light")!;
  }
}
